home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / PacMan / GameActor.h < prev    next >
Encoding:
Text File  |  1992-06-29  |  1.3 KB  |  37 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. // Abstract Class from which ghosts and pacs are derived.
  5. // This basically provides basic variables to hold it's location and
  6. // the necessary methods to access the location instance variables.
  7. // For basic funtionality, -move: and -renderAt::move: need to be overridden
  8. // -move: should set up px and py to  tell the object which way to move
  9. // and renderAt::move: should be able to draw a representation of the
  10. // GameActor.  Note that actual movement happens when -moveOneFrame is
  11. // called; -renderAt::move: will call -moveOneFrame if move:YES is chosen.
  12.  
  13. #import <objc/Object.h>
  14.  
  15.  
  16. @interface GameActor:Object
  17. {
  18.     id  gameView;        // the parent gameView
  19.     
  20.     int myX, myY;        // where we're at
  21.     int lastx, lasty;    // where we were last drawn
  22.     int px, py;            // which way we're going (x-y velocities)
  23. }
  24.  
  25. - init;                // initialize the new instance vars
  26. - (int)xpos;        // return our x-coord
  27. - (int)ypos;        // return our y-coord
  28. - move:sender;        // Move the actor one animation frame
  29. - lastAt:(float *)xx :(float *)yy;    // to find out where actor was last drawn
  30. - at:(float *)xx :(float *)yy;        // where is the actor now?
  31. - moveOneFrame;        // makes the animation advance one step.  Call -move:
  32.                     // first to set up params.
  33. - renderAt:(int)posx :(int)posy move:(BOOL)moveOk;    // draw pac
  34.         // you should lock focus on view that gets the Pac first.
  35.  
  36. @end
  37.